package by.yakusekmaxim.bookgid.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;
import javax.transaction.Transactional;

import by.yakusekmaxim.bookgid.dataaccess.util.Filter;
import by.yakusekmaxim.bookgid.datamodel.Book;
import by.yakusekmaxim.bookgid.datamodel.UserAccount;
import by.yakusekmaxim.bookgid.datamodel.UserAccount2Book;

public interface UserAccount2BookService {
	UserAccount2Book get(Long id);
	
    @Transactional
    void delete(UserAccount2Book userAccount2Book);

    @Transactional
    void deleteAll();
    
    @Transactional
    void saveOrUpdate(UserAccount2Book userAccount2Book);
    
    @Transactional
   	Long getCountByUserAccount(UserAccount user);
    
    @Transactional
	Long getCountByUserAccount(Filter<UserAccount2Book> filter,UserAccount user);
    
    @Transactional
   	Long getCountByBook(Filter<UserAccount2Book> filter,Book book);
    
    @Transactional
	List<UserAccount2Book> getAllUserAccount2BookDao(SingularAttribute<UserAccount2Book, ?> attribute,
			boolean ascending, int startRecord, int pageSize ,UserAccount user);
    @Transactional
	List<UserAccount2Book> getAllUserAccount2BookDao(SingularAttribute<UserAccount2Book, ?> attribute,
			boolean ascending, int startRecord, int pageSize,
			Filter<UserAccount2Book> filter,UserAccount user);
    @Transactional
	UserAccount2Book getUserAccount2BookDao(Book book,UserAccount user);
}
